package lt.hsu.product.vo.req;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lt.hsu.product.entities.ProductEntity;
import lt.hsu.product.vo.valid.ListValueRegex;
import lt.hsu.web.QueryPage;

@Data
@EqualsAndHashCode(callSuper = true )
public class QueryProductReq extends QueryPage<ProductEntity> {

    private String productName;

    @Schema(description = "产品编码",requiredMode = Schema.RequiredMode.REQUIRED)
    @ListValueRegex(pattern = "^[A-Z][A-Z0-9]{5}$",message = "产品编码必须以一个大写字母开头，后面跟4位大写字母或数字")
    private String productCode;

    private boolean nameLike = true;
}
